Digital imaging has, in recent years, become the leading standard by which photographs, designs and other visual elements are captured, created, stored and displayed. Images, like all computer-readable media, contain a significant amount of binary data which employs a significant amount of computing resources, particularly in terms of storage requirements. As a result, compression algorithms and decoders are used to make image information fit into a smaller data file.
Compression algorithms vary widely depending on the nature of the data in question and are well known in the art. In terms of digital imaging, one such algorithm is the JPEG, or Joint Photographic Experts Group compression, as defined in Terminal Equipment and Protocols for Telematic Services: Information Technology—Digital Compression and Coding of Continuous-Tone Still Images—Requirements and Guidelines, CCITT Rec. T.81 (1992 E), which is herein incorporated by reference in its entirety. According to this method, an image file, which is made up of a large matrix of spatial coefficients corresponding to pixel information, is first transformed from the pixel domain to a compressed domain using a mathematical transform. The transform typically employed, as will be appreciated by one skilled in the art, is the Discrete Cosine Transform or DCT. This transform is particularly effective for image compression since it stores the majority of the original signal data in low-frequency components in the transformed, DCT domain. The resultant coefficients in the frequency domain are then quantized, or reduced in size, by factors that depend on the coefficients' relative importance to the overall integrity of the image. This quantization process is a “lossy” compression as some of the image data will be lost as a trade-off for saving space and computing resources. The frequency components of the image that will be most noticeable to the human eye will naturally be quantized to a lower degree, as losses in the information in this frequency range will be more damaging to the overall integrity of the image.
Following quantization, the image file is a matrix of quantized DCT coefficients, also known as quantized DCT indices, and is substantially smaller than the uncompressed binary data that made up the raw image. As a final step, this matrix goes through a process known as entropy encoding to further reduce it in size. Many entropy encoding procedures are known in the art. One such example is Huffman encoding. For the purposes of the following discussion, a person skilled in the art will appreciate that any reference to Huffman decoding can equally refer to any other method of entropy decoding. Once the Huffman encoding process is complete, the resultant file is a JPEG encoded image which can be stored within any kind of computer-readable storage means. JPEG compression is well known in the art, and those of ordinary skill in the field will appreciate that varying techniques in carrying out the process may be used.
In order for the compressed image to be viewed or edited, the compressed image file must go through the reverse of the encoding process. In general, the stored JPEG image first goes through Huffman decoding followed by dequantization, or up-scaling each of the frequency components of the image by the same factor as they were downscaled during compression, and finally, the inverse of the DCT operation. In this manner, the stored JPEG image can then be displayed.
Like the compression process, the decompression requires significant computing power, as many calculations are necessary in order to apply each step of the algorithm. In cases where limited computing power is available, this process can be detrimental to overall system performance and can result in long lag times. This is especially true for mobile handheld devices such as cellphones, PDAs and the like which, by virtue of their size, have reduced computing resources.
There is an additional problem that renders JPEG decompression difficult for handheld devices. Since they almost invariably possess screens which are smaller in size (and/or with lower resolution) than the image which they seek to display, an un-downsampled or spatially un-downscaled image will typically not fit within the confines of the screen. As such, the image must be spatially downscaled, for example, by taking the average of adjacent pixel data or truncating a portion of the pixel coefficients from the image file. Regardless of which method is employed, however, additional calculations must be performed, in order to carry out the spatial downscaling. This can result in increased delay times in loading an image for viewing on a mobile, handheld device. In some cases, important image data is discarded as a sacrifice for faster image processing. This can result in distortion of the image.
It is, therefore, desirable to provide a method to quickly decompress and view JPEG-encoded images using fewer computing resources, while ensuring that the image displayed is as faithful as possible to the source image.